<%@ page pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>
 
<title><fmt:message key="serverProtectList.title"/></title>
<script src="<c:url value='/scripts/common.js'/>"></script>
<meta name="menu" content="ServerProtectMenu"/>
<link rel="stylesheet" type="text/css" media="all"
	href="<c:url value='/styles/css.css'/>" /> 
 <c:if test="${param.protectType eq param.flagType && 2 ne param.protectType}"> 
 <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="30" align="left" background1="images/list_title_bg.jpg"><table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td align="center" valign="bottom">
					 <input type="button" style="margin-right: 5px" class="textarea"
        					onclick="location.href='./serverProtect.html?method=edit&flag=add&taskId=<c:out value="${serverProtectForm.requestId}"/>'"
        			value="<fmt:message key="button.add"/>"/>
 
				</td>
              </tr>
            </table></td>
            <td width="6" align="right" valign="top"><%--img src="images/list_title_right.jpg" width="6" height="30" /--%></td>
          </tr>
        </table> 
 </c:if>       
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
							</tr>
                            <tr> 
                              <td width="88%" align="left" valign="top"><table width="100%" border="1" cellpadding="0" cellspacing="0" class="list_bordercolor">
                                  <tr>
                                    <td class="list_font_title"><fmt:message key="serverProtectForm.id"/> </td> 
                                    <td  class="list_font_title">部门</td>
                                 <c:if test="${1 ne serverProtectForm.protectType && 2 ne serverProtectForm.protectType}">  
	                                 <td  class="list_font_title">实际保障情况</td>
                                 </c:if>
                                 <c:if test="${1 eq serverProtectForm.protectType ||2 eq serverProtectForm.protectType}">     
                                    <td  class="list_font_title"><fmt:message key="serverProtectForm.protectContent"/></td>
								 </c:if>                                    
                                  <c:if test="${1 eq serverProtectForm.protectType||2 eq serverProtectForm.protectType}">  
                                    <td  class="list_font_title" width="50"><fmt:message key="serverProtectForm.ifCheck"/></td>
                                  </c:if>  
                                    <td  class="list_font_title"><fmt:message key="serverProtectForm.regMan"/></td>
                                    <td  class="list_font_title"><fmt:message key="serverProtectForm.regTime"/></td>                                     
                                   <c:if test="${2 eq serverProtectForm.protectType}">
                                    <td  class="list_font_title">审批内容</td>
                                    <td  class="list_font_title">审批时间</td>                                     
                                    <%--td  class="list_font_title">审批人</td--%>


                                   </c:if>
                                     
                                    <td  class="list_font_title" >操作</td>    
                                                
                                                          
                                  </tr>
                                  <c:forEach items="${serverProtectList}" var="results">
                                  <tr>
                                    <td class="list_font_area">&nbsp; <c:out value="${results.id}"/></td> 
                                    <td class="list_font_area">&nbsp; 
                                    <c:if test="${100==results.vipFlag}">
                                    	贵宾室
                                    </c:if>
                                    <c:if test="${101==results.vipFlag}">
                                    	餐饮室
                                    </c:if>
                                    </td>
                                    <td class="list_font_area">&nbsp; <c:out value="${results.protectContent}"/></td>
                                  <c:if test="${1 eq serverProtectForm.protectType || 2 eq serverProtectForm.protectType}">                                      
                                    <td class="list_font_area">&nbsp; 
                                    	<c:if test="${1 ne results.ifCheck}">
                                    		否
                                    	</c:if>
										<c:if test="${1 eq results.ifCheck}">
                                    		是
                                    	</c:if>
                                    </td>
                                   </c:if> 
                                    <td class="list_font_area">&nbsp; <c:out value="${results.regManName}"/></td>
                                    <td class="list_font_area">&nbsp; <c:out value="${results.regTime}"/></td> 
                                 <c:if test="${2 eq serverProtectForm.protectType}">   

                                    <td class="list_font_area">&nbsp; <c:out value="${results.approvContent}"/></td> 
                                    <td class="list_font_area">&nbsp; <c:out value="${results.approvTime}"/></td>                                                                                                             
                                    <%--td class="list_font_area">&nbsp; <c:out value="${results.approvCHMan}"/></td--%> 
                                 </c:if>   
                                    
                                     
                                    <td class="list_font_title">
                                    &nbsp;
                                    <c:if test="${param.protectType eq param.flagType && param.protectType ne 2}">                      
                                     <c:if test="${results.regMan eq serverProtectForm.regMan}">             
                                    <a href="#" onclick="edit(<c:out value="${results.id}"/>)">修改</a>&nbsp;<a href="#" onclick="onDelete(<c:out value="${results.id}"/>)">删除</a>
                                    
                                    </c:if>
                                    </c:if>
                                <c:if test="${param.protectType eq 2}">
                                     <c:if test="${null!=results.ifPass}">
                                     		<c:if test="${0==results.ifPass}">
                                     			不通过
                                     		</c:if>
                                     		<c:if test="${1==results.ifPass}">
                                     			通过
                                     		</c:if>
                                     </c:if>
                                    <c:if test="${null==results.ifPass}">
                                	     <c:if test="${1 eq results.ifCheck}">
                                    		 <a href="#" onclick="approv(<c:out value="${results.id}"/>,<c:out value="${results.vipFlag}"/>,<c:out value="${param.protectType}"/>)">审批</a>&nbsp;
                                     	 </c:if>
									</c:if>                                     
                                </c:if>
                                    </td>
                                  </tr>
                               	</c:forEach>
                              </table></td>
                            </tr>
                            
                        </table>

<script>
	function edit(id){
		location.href='./serverProtect.html?method=edit&protectType=<c:out value="${param.protectType}"/>&id='+id;
		
	}

	function approv(id,vipFlag,protectType){  
		var workFlow = '&processinstid=<c:out value="${param.processinstid}"/>&workItemId=<c:out value="${param.workItemId}"/>&appId=<c:out value="${param.appId}"/>&vipFlag='+vipFlag+'&protectType='+protectType;		
		MM_openBrWindow('./serverProtect.html?method=approv&id='+id+workFlow,'','width=400,height=200,status=yes');
	 
	}
	
	function onDelete(id){
		if(confirm('真的要删除该记录吗？')){
			location.href='./serverProtect.html?method=delete&id='+id;
		}	
		
	}
	
</script> 